﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HiddenField2.aspx.cs" Inherits="HiddenField2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">
    function Purchase(item,Amt) {
        var amt = document.getElementById('Amount1');
        var item_One = document.getElementById('item_One');
        amt.value = amt.value + Amt;
        item_One.value= item_One.value + item;
    }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <a href ="HiddenField.aspx">Hidden field </a>
    <div>
        <asp:HiddenField ID="Amount1" runat="server"  Value="0" /><br />
         <asp:HiddenField ID="item_One" runat="server"  /><br />
         
       
        <asp:Label ID="lblPurchase" runat="server" ></asp:Label><br />
        <span id="spnItem1">Shirt</span> &nbsp &nbsp <span id ="spnAmount1">34.00</span> &nbsp <input type ="button" onclick="Purchase(spnItem1.innerHTML,spnAmount1.innerHTML)" value="By Now" />
        <span id="spnItem2">Slacks</span> &nbsp &nbsp <span id ="spnAmount2">50.00</span> &nbsp <input type ="button" onclick="Purchase(spnItem2.innerHTML,spnAmount2.innerHTML)" value="By Now" />
        <span id="spnItem3">Mat</span> &nbsp &nbsp <span id ="spnAmount3">20.00</span> &nbsp <input type ="button" onclick="Purchase(spnItem3.innerHTML,spnAmount3.innerHTML)" value="By Now" />
        <span id="spnItem4">Coat</span> &nbsp &nbsp <span id ="spnAmount4">125.00</span> &nbsp <input type ="button" onclick="Purchase(spnItem4.innerHTML,spnAmount4.innerHTML)" value="By Now" />
      <br />  <asp:Button ID="BtnSubmit" runat="server" Text="Submit" /><br />
    </div>
    </div><a href ="Default.aspx">Back</a>
    </form>
</body>
</html>
